<extend name="Public/base" />

<block name="body">
  <!-- 标题栏 -->
  <div class="main-title">
    <h2>{$meta_title}</h2>
  </div>

  <!-- 按钮工具栏 -->
  <div class="cf">
    
    <div class="fl">
      <a class="btn" href="{:U('index')}">刷 新 <span style="font-size:12px;font-weight:normal">(清空搜索条件)</span></a>
    </div>

    <!-- 高级搜索 -->
    <form id="J_search_form" action="{:U('index')}" method="GET">
      <div class="search-form fr cf">
        <div class="sleft">
          <select name="grade">
            <option value="0">店铺等级</option>
            <volist name="grade" id="vo">
              <option value="{$key}" <eq name="_GET.grade" value="$key">selected</eq> >{$vo}</option>
            </volist>
          </select>
        </div>
        <div class="sleft">
          <input type="text" name="store" class="search-input" value="{:I('store')}" placeholder="请输入店铺名称">
        </div>
        <div class="fl">
          <select name="status">
            <option value="all">店铺状态</option>
            <option value="0" <eq name="_GET.status" value="0"> selected</eq>>禁用</option>
            <option value="1" <eq name="_GET.status" value="1"> selected</eq>>开启</option>
            <option value="2" <eq name="_GET.status" value="2"> selected</eq>>即将到期</option>
            <option value="3" <eq name="_GET.status" value="3"> selected</eq>>已到期</option>
          </select>
        </div>
        <div class="sleft">
          <input type="text" name="seller" class="search-input" value="{:I('seller')}" placeholder="请输入店主卖家账号">
          <a class="sch-btn" href="javascript:;" id="J_search"><i class="btn-search"></i></a>
        </div>
      </div>
    </form>
  </div>
  
  <!-- 数据列表 -->
  <div class="data-table table-striped">
    <table class="">
      <thead>
        <tr>
          <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
          <th>店铺</th>
          <th>绑定用户</th>
          <th>店主卖家账号</th>
          <th>联系方式</th>
          <th>店铺等级</th>
          <th>店铺到期时间</th>
          <th>状态</th>
          <th>操作</th>
        </tr>
      </thead>
      <tbody>
        <notempty name="lists">
          <volist name="lists" id="vo">
            <php>if($vo['status'] <= 0){</php>
              <tr class="status_trclass_0">
            <php>}else{</php>
              <tr class="status_trclass_1">
            <php>}</php>
              <td><input class="ids" type="checkbox" name="ids[]" value="{$vo.store_id}" /></td>
              <td><a href="{:U('detail?member_id='.$vo['member_id'])}">{$vo.store_name}</a> </td>
              <td>{$vo.member_name}</td>
              <td>{$vo.seller_name}</td>
              <td>{$vo.tel}</td>
              <td>{$grade[$vo['grade_id']]}</td>
              <empty name="vo.end_time">
              <td>无限制</td>
              <else/>
              <td>{$vo.end_time|time_format}</td>
              </empty>
              <td>{$vo.status_text}</td>
              <td>
                <a href="{:U('detail?member_id='.$vo['member_id'])}">[查看]</a>
                <a href="{:U('sellCategory?id='.$vo['store_id'])}">[经营类目]</a>
                <a href="{:U('edit?id='.$vo['store_id'])}">[编辑]</a>
				<if condition="C('START_POSITION') eq 1">  	
			     <a href="{:U('storeAddress?id='.$vo['member_id'])}">[查看详细地址]</a>
                </if>
               <!--  <a style="color:#f2966e" href="storeAddressEdit?id=<?php echo $vo['member_id'];?>">[审核请求查看]</a> -->
                
                <if condition="C('START_POSITION') eq 1"> 
					<if condition="$vo['is_edit'] eq 1">
					  <a class="confirm" href="{:U('storeAddressEdit?id='.$vo['member_id'])}">[待处理审核请求]</a>
					<else />
					  <span class="text-cancel">暂无待审核请求</span>
				   </if>
			   </if>
                

              <if condition="C('START_POSITION') eq 1">  
              <a href="{:U('available_zone?id='.$vo['store_id'])}">[设置可售区域]</a>
              </if>
                <switch name="vo.status">
  	              <case value="0"><a class="confirm ajax-get" href="{:U('setStatus?id='.$vo['store_id'].'&status=1')}">[开启]</a></case>
  	              <case value="1"><a class="confirm ajax-get" data-text="确定要执行吗？禁用后商品所有商品下架！" href="{:U('setStatus?id='.$vo['store_id'].'&status=0')}">[禁用]</a></case>
	             </switch>
              </td>
            </tr>
          </volist>
        <else/>
          <td colspan="10" class="text-center"> aOh! 暂时还没有内容! </td>
        </notempty>
      </tbody>
    </table>
  </div>
  <div class="page">
    {$_page}
  </div>
</block>

<block name="script">
  <script type="text/javascript" charset="utf-8">
    //导航高亮
    highlight_subnav('{:U('Store/index')}');
  </script>
</block>
